/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.flexengine.math;

/**
 * @author Luann R. Athayde
 * @version 1.0
 * @since 1.0
 */
public class Sphere extends Form3D {
    
    private float radius;

    public Sphere() {
        this("Sphere", 0f, 0f, 0f, 0f);
    }

    public Sphere(String name) {
        this(name, 0f, 0f, 0f, 0f);
    }

    public Sphere(String name, float x, float y, float z, float radius) {
        super(name, x, y, z);
        this.radius = radius;
    }
    
    public float getRadius() {
        return radius;
    }

    public void setRadius(float radius) {
        this.radius = radius;
    }
    
    @Override
    public float getArea() {
        return (float)(4 * Math.PI * radius * radius);
    }
    
    @Override
    public float getVolume() {
        return (float)(4/3 * Math.PI * radius * radius * radius);
    }

    @Override
    public String toString() {
        return getName()+"{" + "x=" + getX() + ", y=" + getY() + ", z=" + getZ() + ", radius=" + radius + '}';
    }
    
}
